home *** CD-ROM | disk | FTP | other *** search
- From: boukanov@sentef1.fi.uib.no (Igor Boukanov)
- Message-ID: <4ia9bj$atj@ugress.uib.no>
- X-Original-Date: 14 Mar 1996 23:16:03 GMT
- Path: in2.uu.net!bounce-back
- Date: 15 Mar 96 00:33:41 GMT
- Approved: fjh@cs.mu.oz.au
- Newsgroups: comp.std.c++
- Subject: Access to private base class?
- Organization: Fysisk institutt, Universitetet i Bergen
- Summary: Some lines from DWP show how to get access to private base class(???).
- Keywords: C++, private class
- X-Newsreader: TIN [version 1.2 PL2]
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBFAgUBMUi7A+EDnX0m9pzZAQGQMgF+IvCNU8O9XV2SgL2IvtaChT2q8H+gd622
- DurYTvDzkjVwH1PgOrumjNi7yzl2dy97
- =7jjV
-
- Here the lines from September DWP, 5.2.6.9:
-
- [Example:
- class A { virtual void f(); };
- class B { virtual void g(); };
- class D : public virtual A, private B {};
- void g()
- {
- D d;
- B* bp = (B*)&d; // cast needed to break protection
- ...
-
- Does "cast needed to break protection" mean that in this case it is possible
- to get access to the private base class by simple cast expression?
-
- --
- Regards, Igor Boukanov (igor.boukanov@fi.uib.no).
- ---
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-